/*
 * @Author: Mr.Hope
 * @LastEditors: Mr.Hope
 * @Description: 路由配置文件
 * @Date: 2019-03-25 12:27:33
 * @LastEditTime: 2019-11-20 21:28:32
 */
import Main from '@/views/Main.vue';
import Page404 from '@/views/Page404.vue';
import aboutRoutes from './routes/about';
import docRoutes from './routes/doc';
import toolRoutes from './routes/tool';
import privateRoutes from './routes/private';

const route = [
  {
    path: '/',
    alias: '/index.html',
    name: 'main',
    component: Main
  },
  {
    path: '/page',
    alias: '/guide',
    name: 'guide',
    meta: { title: '新生攻略' },
    // 使用import来进行异步调用实现懒加载，打包时，webpack会识别webpackChunkName注释，将相同的一起打包一同执行懒加载
    component: () => import(/* webpackChunkName: "guide" */ '@/views/Guide.vue')
  },
  {
    path: '/guide/:path',
    props: true,
    meta: { title: '东师指南' },
    component: () => import(/* webpackChunkName: "guide" */ '@/views/Page.vue')
  },
  ...toolRoutes,
  ...docRoutes,
  ...privateRoutes,
  ...aboutRoutes,
  {
    path: '/scence',
    name: 'scence',
    meta: { title: '东师风貌' },
    component: () =>
      import(/* webpackChunkName: "scence" */ '@/views/scence/Scence.vue')
  },
  {
    path: '/scence/benbu',
    name: 'benbuScence',
    meta: { title: '本部风貌' },
    component: () =>
      import(/* webpackChunkName: "scence" */ '@/views/scence/Benbu.vue')
  },
  {
    path: '/scence/jingyue',
    name: 'jingyueScence',
    meta: { title: '净月风貌' },
    component: () =>
      import(/* webpackChunkName: "scence" */ '@/views/scence/Jingyue.vue')
  },
  {
    path: '*',
    name: '404',
    meta: { title: '未找到界面' },
    component: Page404
  }
];

export default route;
